57 research outputs found

    Resource Access with Variably Typed Return

    Get PDF
    Peer reviewedPreprin

    JEqualityGen: Generating Equality and Hashing Methods

    No full text
    Manually implementing equals (for object comparisons) and hashCode (for object hashing) methods in large software projects is tedious and error-prone. This is due to many special cases, such as field shadowing, comparison between different types, or cyclic object graphs. Here, we present JEqualityGen, a source code generator that automatically derives implementations of these methods. JEqualityGen proceeds in two states: it first uses source code reflection in MetaAspectJ to generate aspects that contain the method implementations, before it uses weaving on the bytecode level to insert these into the target application. JEqualityGen generates not only correct, but efficient source code that on a typical large-scale Java application exhibits a performance improvement of more than two orders of magnitude in the equality operations generated, compared to an existing system based on runtime reflection. JEqualityGen achieves this by generating runtime profiling code that collects data. This enables it to generate optimised method implementations in a second round

    Risky Business: Motivations for Markets in Programmable Networks

    Get PDF
    Abstract. We believe that the problems of safety, security and resource usage combine to make it unlikely that programmable networks will ever be viable without mechanisms to transfer risk from the platform provider to the user and the programmer. However, we have well established mechanisms for managing risk -markets. In this paper we argue for the establishment of markets to manage the risk in running a piece of software and to ensure that the risk is reflected on all the stakeholders. We describe a strawman architecture for third party computation in the programmable network. Within this architecture, we identify two major novel features:-Dynamic price setting, and a reputation service. We investigate the feasibility of these features and provide evidence that a practical system can indeed be built. Our contributions are in the argument for markets providing a risk management mechanism for programmable networks, the development of an economic model showing incentives for developing better software, and in the first analysis of a real transaction graph for reputation systems from an Internet commerce site

    Innocent strategies as presheaves and interactive equivalences for CCS

    Get PDF
    Seeking a general framework for reasoning about and comparing programming languages, we derive a new view of Milner's CCS. We construct a category E of plays, and a subcategory V of views. We argue that presheaves on V adequately represent innocent strategies, in the sense of game semantics. We then equip innocent strategies with a simple notion of interaction. This results in an interpretation of CCS. Based on this, we propose a notion of interactive equivalence for innocent strategies, which is close in spirit to Beffara's interpretation of testing equivalences in concurrency theory. In this framework we prove that the analogues of fair and must testing equivalences coincide, while they differ in the standard setting.Comment: In Proceedings ICE 2011, arXiv:1108.014

    Deconstructing behavioural theories of mobility

    No full text
    We re-examine the standard structural operational semantics of the π-calculus with the view that both process structure and contextual observational power should play roles in describing the behavioural theory. To that end we provide a decomposition of the operational semantics of π which allows for a systematic definition of labelled transitions. These are derived from the calculus’ underlying reduction rules by following the contexts-as-labels philosophy while being presented using the structural approach. Our novel transition system refines to a composite description of the standard early lts. We generalise our technique to higher-order and asynchronous variants

    Making the unobservable, unobservable

    Get PDF
    Behavioural equivalences of various calculi for modelling distributed systems differ significantly because the properties which can be observed through interaction depend heavily upon their mode of communication. A typical approach to describing the semantics of communicating processes is to provide a labelled transition system (lts) which captures the interaction potential of the individual processes within a larger system. In many cases, a natural rendering of this lts leads to too fine a semantics as unobservability of certain communications is not accounted for. We propose that a standard approach to augmenting ltss allows morally unobservable communications to actually be modelled as unobservables in the semantics. This approach derives from a rule initially given by Honda and Tokoro to account for unobservability of reception in the asynchronous π-calculus. We examine the implications of adding such rules to lts with respect to the proving behavioural equivalences for various synchronisation mechanisms

    Generating correct and efficient equality and hashing methods using JEqualityGen

    No full text
    Determining equality of objects in Java requires the implementation of equals and hashCode methods. Such an implementation has to follow a specific object contract, making it a very tedious and error-prone process. Many equality and hashing methods implemented in Java applications violate this contract and are faulty, due to complexity arising from field shadowing, comparisons between different types, object cycles, etc. Equality and hashing implementations are conceptually simple, and can be derived automatically from information obtained statically from the program. However, existing systems that generate equality implementations use reflection and are consequently inefficient. Here we describe JEqualityGen, a source code generator that seamlessly integrates with the build process of typical Java projects: the programmer only needs to indicate for which classes implementations should be generated. JEqualityGen produces correct and efficient code which on a typical large-scale Java application exhibits a typical performance improvement of 162x in the equality operations generated by existing reflective systems. This was made possible through the use of optimised code generation and runtime profiling of these methods
    corecore